import type { IColumnsOption } from 'vc';
import { INDEX, COMPANY_NAME, BUSINESS_DATA, REGISTERED_CAPITAL, PROVINCE, CITY, COUNTRY, INDUSTRY_CATEGORY, INFO_SOURCE, TAG_YEAR } from '@/utils/tableColumn';

export function useTable() {
  const columns = ref<IColumnsOption[]>([
    { ...INDEX },
    { ...COMPANY_NAME },
    {
      width: 120,
      align: 'center',
      title: '披露日期',
      field: 'noticeDate',
      sortable: true
    },
    {
      ...INFO_SOURCE('catalogueName'),
      field: 'catalogueName'
    },
    {
      width: 165,
      title: '产品型号',
      field: 'productModel'
    },
    {
      width: 150,
      title: '产品大类',
      field: 'productType',
      sortable: true
    },
    {
      width: 150,
      title: '产品子类',
      field: 'productSubType',
      align: 'center'
    },
    {
      width: 150,
      title: '产品名称',
      field: 'productName',
      align: 'center',
      showOverflow: 'title'
    },
    {
      ...TAG_YEAR,
      field: 'statisticalYear',
      sortable: true
    },
    {
      title: '发证机关',
      field: 'evaluationAuthority',
      width: 120
    },
    { ...PROVINCE },
    { ...CITY },
    { ...COUNTRY },
    { ...INDUSTRY_CATEGORY },
    { ...BUSINESS_DATA },
    { ...REGISTERED_CAPITAL }
  ]);

  return {
    columns
  };
}
